package com.summer.wxapp.model;

import java.util.Date;

import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.FetchType;
import javax.persistence.Id;
import javax.persistence.JoinColumn;
import javax.persistence.ManyToOne;
import javax.persistence.Table;

import org.hibernate.annotations.Cache;
import org.hibernate.annotations.CacheConcurrencyStrategy;

import com.summer.user.model.User;

/**
 * WeUser entity. 用户
 */
@Entity
@Table(name = "we_app_user")
@Cache(usage = CacheConcurrencyStrategy.READ_WRITE, region = "entityCache")
public class WeAppUser implements java.io.Serializable {

	private Integer subscribe;
	private String openid;
	private String nickname;
	private Integer sex;
	private String city;
	private String country;
	private String province;
	private String language;
	private String headimgurl;
	private Long subscribe_time;
	private String unionid;
	private String remark;
	private Integer groupid;
	private Integer status;
	private User user;
	
	private Date subscribedTime;
	private Date unsubscribedTime;
	private Date bindindTime;

	@ManyToOne(fetch = FetchType.LAZY)
	@JoinColumn(name = "xhqid", nullable = false)
	public User getUser() {
		return user;
	}

	public void setUser(User user) {
		this.user = user;
	}
	
	@Column(name = "subscribe")
	public Integer getSubscribe() {
		return subscribe;
	}

	public void setSubscribe(Integer subscribe) {
		this.subscribe = subscribe;
	}

	@Id
	@Column(name = "openid", unique = true, nullable = false, length = 100)
	public String getOpenid() {
		return openid;
	}
	public void setOpenid(String openid) {
		this.openid = openid;
	}

	@Column(name = "nickname" ,length=100)
	public String getNickname() {
		return nickname;
	}

	public void setNickname(String nickname) {
		this.nickname = nickname;
	}

	@Column(name = "sex")
	public Integer getSex() {
		return sex;
	}

	public void setSex(Integer sex) {
		this.sex = sex;
	}

	@Column(name = "city" ,length=100)
	public String getCity() {
		return city;
	}

	public void setCity(String city) {
		this.city = city;
	}

	@Column(name = "country" ,length=100)
	public String getCountry() {
		return country;
	}

	public void setCountry(String country) {
		this.country = country;
	}

	@Column(name = "province" ,length=100)
	public String getProvince() {
		return province;
	}

	public void setProvince(String province) {
		this.province = province;
	}

	@Column(name = "language" ,length=100)
	public String getLanguage() {
		return language;
	}

	public void setLanguage(String language) {
		this.language = language;
	}

	@Column(name = "headimgurl" ,length=500)
	public String getHeadimgurl() {
		return headimgurl;
	}

	public void setHeadimgurl(String headimgurl) {
		this.headimgurl = headimgurl;
	}

	@Column(name = "subscribe_time")
	public Long getSubscribe_time() {
		return subscribe_time;
	}

	public void setSubscribe_time(Long subscribe_time) {
		this.subscribe_time = subscribe_time;
	}

	@Column(name = "unionid" ,length=500)
	public String getUnionid() {
		return unionid;
	}

	public void setUnionid(String unionid) {
		this.unionid = unionid;
	}

	@Column(name = "remark" ,length=200)
	public String getRemark() {
		return remark;
	}

	public void setRemark(String remark) {
		this.remark = remark;
	}

	@Column(name = "groupid")
	public Integer getGroupid() {
		return groupid;
	}

	public void setGroupid(Integer groupid) {
		this.groupid = groupid;
	}

	@Column(name = "status")
	public Integer getStatus() {
		return status;
	}

	public void setStatus(Integer status) {
		this.status = status;
	}
	
	@Column(name = "SUBSCRIBED_TIME")
	public Date getSubscribedTime() {
		return subscribedTime;
	}

	public void setSubscribedTime(Date subscribedTime) {
		this.subscribedTime = subscribedTime;
	}
	
	@Column(name = "UNSUBSCRIBE_TIME")
	public Date getUnsubscribedTime() {
		return unsubscribedTime;
	}

	public void setUnsubscribedTime(Date unsubscribedTime) {
		this.unsubscribedTime = unsubscribedTime;
	}
	
	@Column(name = "BINDING_TIME")
	public Date getBindindTime() {
		return bindindTime;
	}

	public void setBindindTime(Date bindindTime) {
		this.bindindTime = bindindTime;
	}
	
}
